home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
181_01
/
cugutl.doc
< prev
next >
Wrap
Text File
|
1984-01-15
|
7KB
|
207 lines
C U G I N S
The CUGINS program allows users to insert a HEADER TEMPLATE in a
series of files. A common example is program made up of many source
modules (i.e. YACC has 53 Source Modules and 2 Document Modules),
the CUG headers on these types of files are identical except
for the Filename entry.
To use this program the user must provide a HEADER TEMPLATE and a
list of the files to be processed.
The following is a example of such a Template:
/*
HEADER: CUG nnn.nn;
TITLE: YACC - Yet Another Compilier-Compilier
VERSION: 1.0 for IBM-PC
DATE: Sep 20, 195
DESCRIPTION: LALR(1) Parser Generator. From UNIX
KEYWORDS: Parser Generator Compilier-Compilier YACC
SYSTEM: IBM-PC and Compatiables
FILENAME:
WARNINGS: This program is not for the casual user. It will
be useful primarily to expert developers.
CRC: N/A
SEE-ALSO: LEX and PREP
AUTHORS: Scott Guthery 11100 leadfwood lane Austin, TX 78750
COMPILERS: DESMET-C
REFERENCES: UNIX Systems Manuals
*/
Notice that the Filename entry is blank. This entry is automatically
filled in by the CUGINS Program. The Replacement Offset Parameter is
used to insure that the replacement text will be insert in the correct
place. In the case of example Template, the offset would be 6. This
would insure that the replacement text lined up with the other data.
The list of files to be processed can be generated by any editor. The
general practice for a large number of files is to cause the DIR
command to write a directory to disk and then use an editor to clean
up the file for use by CUGINS. The file names must be listed one
per line and can be any legal file expression recognized by DOS.
To generate a directory on disk:
B> DIR >DIR.DAT
The resulting disk file would look something like the following:
Volume in drive B has no label
Directory of B:\
CUGINS PAS 7132 1-08-84 6:09p
HEADER DAT 642 1-08-84 5:12p
REST BAT 89 1-07-84 8:41p
CUGINS COM 14256 1-08-84 6:09p
LIST DAT 19 1-08-84 6:11p
Y1IMP C 712 1-08-84 6:14p
Y2IMP C 712 1-08-84 6:14p
TURBOF3 MAC 319 1-08-84 7:42p
Y1IMP CAK 57 1-08-84 6:00p
Y2IMP CAK 57 1-08-84 6:00p
CUGINS BAK 1131 1-08-84 7:56p
CUGINS DOC 1893 1-08-84 8:05p
DIR DAT 0 1-08-84 8:05p
13 File(s) 320512 bytes free
After cleaning the file up we could be left with:
Y1IMP.C
Y2IMP.C
Y3IMP.C
===============================
Now that the two data files we need have been created, the program
is executed as follows:
B> CUGINS list.dat header.dat 6
The file "list.dat" contains the list of files to be processed.
The file "header.dat" contains the HEADER TEMPLATE Data.
The third parameter, "Replacement Offset", is optional. If missing
it has the value of ONE(1).
If the "list.dat" or "header.dat" are not present, the user will
be requested to enter the correct file name.
Once the file list, "list.dat", and the HEADER TEMPLATE, "header.dat",
have been successfully loaded, the program will begin processing the
files in "list.dat". As each file is processed it's file specification
will be printed on the users terminal.
With the list specified above, the following would appear on the
users terminal:
B> CUGINS list.dat header.dat 6
Y1IMP.C
Y2IMP.C
Y3IMP.C
If the user enters CUGINS without the correct number of parameters
(2 or 3), the program will simply print out a brief usage description,
distribution rights and my copyright notice.
C U G E D T
This program, CUGEDT, will allow a user to edit an entries in the CUG
Headers on a whole series modules.
It works almost the same as CUGINS described above, with the following
glaring differences.
1) The program name is CUGEDT, NOT CUGINS! (Rather Obvious)
2) The HEADER TEMPLATE File is now called an EDIT File.
3) The first two lines of the EDIT File specify the starting
element of the area in the CUG file to be deleted (first line)
and the element following the deleted area. (ie. The ending
element is not deleted!)
4) Line 3 through the last line comprise the text that will be
inserted in place of the deleted text.
When this program is run, all files in the input file list will be
processed as follows:
1) If the Starting Text key (Line one in the EDIT File) is found
in the text file, all text including the start line will be
deleted up to, but not including, the termination line (line
two in the EDIT File).
2) The replacement text (Lines 3 through "n") will be inserted
in the text file IN FRONT OF THE TERMINATION LINE.
For example, if the CUG Header looks the same as the one shown above,
then the following EDIT File would replace the compilier information
element.
EDIT File
COMPILERS:
REFERENCES:
COMPILERS: DESMET-C
CI-86
LATTICE
After running CUGEDT (i.e. CUGEDT FILE.LST EDIT.FIL<CR> ) the header
shown above would look as follows:
/*
HEADER: CUG nnn.nn;
TITLE: YACC - Yet Another Compilier-Compilier
VERSION: 1.0 for IBM-PC
DATE: Sep 20, 195
DESCRIPTION: LALR(1) Parser Generator. From UNIX
KEYWORDS: Parser Generator Compilier-Compilier YACC
SYSTEM: IBM-PC and Compatiables
FILENAME:
WARNINGS: This program is not for the casual user. It will
be useful primarily to expert developers.
CRC: N/A
SEE-ALSO: LEX and PREP
AUTHORS: Scott Guthery 11100 leadfwood lane Austin, TX 78750
COMPILERS: DESMET-C
CI-86
LATTICE
REFERENCES: UNIX Systems Manuals
*/
AUTHOR: C.E. Thornton [ Box 55085 Houston, TX 77255: (713) 467-1651) ]
APPLICATION: Setting up CUG Disks for their library
DATE: Sept 29, 1985
NOTE: This software may be freely distributed and used by non-commerical
users. Users Groups and Clubs may charge reasonable (less than $15)
distribution fees. Contributions are always gratefully recieved.
G E N E R A L I N F O R M A T I O N
If you have any questions, feel free to call the number below at anytime
between 8:00pm and 11:00pm weekdays and any reasonable time on weekends.
This program is written in Turbo PASCAL and the source is available for
one 5 1/4 inch floppy disk and $5.00.
C.E. Thornton
PASCAL/"C" LIBRARIAN
P.O. Box 55085
Houston, Tx 77255
(713) 467 - 1651
>>>> Copyright Sept 1985 by C.E. Thornton